// 452. 用最少数量的箭引爆气球
function findMinArrowShots(points: number[][]): number {
    if(points.length==0) return 0
    points.sort((a,b)=>a[0]-b[0])
    let right = points[0][1]
    let ans = 1
    for(let [x,y] of points){
        //判断两个区间右-左有没有交界
        if(x>right){
            right = y
            ans++
        }
        else{
            right = Math.min(right,y)
        }
    }
    return ans
};